import string

fr = open('../data/rt-polaritydata/rt-polarity.pos', 'r')
fw = open('../data/clean-data/positives.txt', 'w')

for line in fr.readlines():
    line = line.rstrip('\n')
    t = list(line)
    t = [s.replace('-', ' ') for s in t]
    t = [s.replace('/', ' ') for s in t]
    line = "".join(t)
    line = line.translate(string.maketrans("",""), string.punctuation)
    fw.write(line + '.' + '\n')

fr.close()
fw.close()

fr = open('../data/rt-polaritydata/rt-polarity.neg', 'r')
fw = open('../data/clean-data/negatives.txt', 'w')

for line in fr.readlines():
    line = line.rstrip('\n')
    t = list(line)
    t = [s.replace('-', ' ') for s in t]
    t = [s.replace('/', ' ') for s in t]
    line = "".join(t)
    line = line.translate(string.maketrans("",""), string.punctuation)
    fw.write(line + '.' + '\n')

fr.close()
fw.close()
